/**
 * Created by yfx on 2016-10-24.
 */
import { RIGHT_HEADER_CHANGE } from '../actions/right'
export default function right (state = {
    headerRight:"index"
}, action) {
    //state永远是上一次的值,dispatch传入action的值
    switch (action.type) {
        case RIGHT_HEADER_CHANGE:
            if(action.headerRight!=null&&action.headerRight!=state.headerRight){
                return Object.assign({}, state, {
                    headerRight:action.headerRight
                });
            }
            return state;
        default:
            return state;
    }
}